package com.zxm.web.controller.message;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @Author silence.Z
 * @Date 2022/8/29 13:41
 * @PackageName:com.zxm.web.controller.message
 * @ClassName: SseListener
 * @Description: TODO
 * @Version 1.0
 */
@Slf4j
@Component
public class SseListener implements ApplicationListener<SseEvent> {
	@Override
	public void onApplicationEvent(SseEvent event) {
		SseEmitterServer.sendMessage(event.getUserId(), event.getMsg());
		SseController.publicMsg(event);
	}
}
